The online racing simulator
Searching in All forums
(951 results)
Yisc[NL]
S3 licensed
You worked with Lapper before, so shouldn't have any problem setting Lapper up straight out of the box.
Since you will be starting from scratch, you can decide anything you want, like:

- Do I want one database for both servers or a database for each server
- Which features do I want and does Lapper have them by default or do I need to make them (ask someone to make them)
- Figure out the details of those features as it's easier to build all in one go, then to keep adding things, which will get messy at some point (codewise that is)
Yisc[NL]
S3 licensed
Hahaha, well found, although my script does have some history that can be viewed.
Yisc[NL]
S3 licensed
I've quickly made the requested script.
It's very basic, but does what you asked for.
All yours to tailor it to your own style and wishes.

Change the extension of the file to .lpr and add it to addonsused.lpr to be able to use it.
Yisc[NL]
S3 licensed
Glad it's working for you now and a nice system you made there.
Good luck with future coding within the Lapper environment and feel free to ask help/directions if you need to.
Yisc[NL]
S3 licensed
I don't know if you problem is already solved, but if it isn't, I might have something that helps you.

I've tested this piece of code:


<?php 
Privmsg 
("^7DEBUG: " ToNumRound( (247 130 2.86 ),) ) );
?>

Which is nearly the same as you had, except that I put in '130' instead of 'GetUserStoredValue($userName," 1XRT")'
The DEBUG message then said: 202
This is the correct answer as 130 / 2.86 = 45.45454545454545 = rounded to zero decimals: 45
Then 247-45 = 202

So the round function is working correctly, when using a static number, which makes me think that the problem is related to the GetUserStoredValue.
Then I tried this:


<?php 
$userName 
GetCurrentPlayerVar"UserName" );
Privmsg ("^7DEBUG: " ToNumRound( (247 GetUserStoredValue($userName," 1XRT") / 2.86 ),) ) );
?>

Still no error about the round function, but I wasn't getting the value '1XRT' either.
After having a close look, I noticed you have a space before 1XRT, so I tried this:


<?php 
$userName 
GetCurrentPlayerVar"UserName" );
Privmsg ("^7DEBUG: " ToNumRound( (247 GetUserStoredValue($userName,"1XRT") / 2.86 ),) ) );
?>

Now the DEBUG messages said again: 202

Since I had a problem with numbers being retrieved, while working on the cross-server chat script, I think it would be a good idea to replace GetUserStoredValue with GetUserStoredNum, as that will make sure a number is retrieved from the database.
Hopefully this will help you, otherwise I will be happy to give any assistance.
Yisc[NL]
S3 licensed
I haven't been able to reproduce the mentioned bugs anymore (and I tried seriously).
Still have some ideas how this script could be improved, but don't consider them high priority right now.
Yisc[NL]
S3 licensed
Thanks for testing, I've seen that first thing myself as well, but couldn't reproduce it solidly.
Will have another look and crack at that one.
The other one I haven't seen myself, but I have an idea what causes it (can even be the same cause as the first issue).
Yisc[NL]
S3 licensed
I couldn't find any time to look into the reported issue yesterday, but did find some time today.
Soon I was able to replicate the problem Bass-Driver reported and I ran into another problem as well.
After some attempts to fix both of them, I succeeded, so here's another version.
I've tested with 2 LFS servers running on the same Lapper and also tested by adding short messages (by pressing 'Click to type a short message (max. 72 char) button) as well as longer messages using: !chat [longer message here]

Changelog Cross-server chat V1.02:

-Fixed a bug that caused displaying empty messages when starting from scratch
-Fixed a bug that caused Lapper to throw messages about database being locked
-Changed GetStoredValue to GetStoredNum where possible to get numbers instead of values

Change the extension of the file to .lpr and add it to addonsused.lpr to be able to use it.
Last edited by Yisc[NL], .
Yisc[NL]
S3 licensed
Hmm, seen this error once, but thought it was caused by an external program I use to view/edit the Lapper database.
I haven't done any testing with multiple servers as I assumed it should work, as storedvalue.dbs already is used by multiple Lapper instances (like I have on the AB.nl server (4 LFS servers and all of them have Lapper as well).
Will do some testing tomorrow.
Last edited by Yisc[NL], .
Yisc[NL]
S3 licensed
It did some more work on the Proof Of Concept (POC) for a cross-chat server addon for Lapper.
See attached script.
As said, it's a proof of concept so don't ask me about, I want this, can you make that, ect. it's just to proof it's possible to have such script and I have no intention (at the moment) to further extend this script.
Let me know if it is (or isn't) working for those who have multiple servers.


Change the extension of the file to .lpr and add it to addonsused.lpr to be able to use it.
Yisc[NL]
S3 licensed
Could indeed be a useful function.
Now when I want to do some maintanance and people are indeed driving on several of my servers, I have to go to each LFS console and write a message there (or login on each server and write in chat there).
Yisc[NL]
S3 licensed
I was in the mood to tackle this request, so I worked on a cross-server chat this afternoon and came up with a proof of concept.

When typing: !chat
You will bring up a GUI to show the last 5 messages (date,time,message) and a button to compose a short (max. 72 characters) message.
After having composed the message, you will get to see a send button and once that is pressed, the message is stored in the Lapper database (it can be done using a text file as well, but using the storevalue.dbs is a better way to handle this).

Another way to enter a message into the chat is by typing: !chat [write your message here]
Using this method, you can write a longer line of text.

There are some things I want to tackle before I release this proof of concept to the community, but at least I know for sure now it can be done and even isn't too hard to accomplish.
Last edited by Yisc[NL], .
Yisc[NL]
S3 licensed
No, Lapper haven't got such feature, but it can be made using a text file to store/retrieve text, which can be read/written by multiple servers
Yisc[NL]
S3 licensed
Looking very good and impressive you did all within Lapper.
Keep up the good work.
Yisc[NL]
S3 licensed
I am willing to help (as others have tried to help as well) but you both should provide more information.
Do you see any errors in the ERR logfile that can be found in "LFSLapper V7.0.4.10\bin\default\logs" and if so, what are these errors?

It might also be a good idea to ZIP your includes directory and upload it to this forum, so we can look at the files and see if we can spot a problem.
Yisc[NL]
S3 licensed
Right, I've fixed the bug with the UserGroupFromFile problem.
Apparently, I am loading that group in one of my other scripts and therefor never ran into this problem.
Now it's loaded in this script (as well), so the list of admins is there.

Changelog for Set Schedule V2.02:

-Added UserGroupFromFile to Sub 'OnMSO'

Change the extension of the file to .lpr and add it to addonsused.lpr to be able to use it.
Yisc[NL]
S3 licensed
I will look into the issue with being an admin or not.

The message on the console is selfexplaining Smile
Lapper checks if the value 'SCHDL_CHECK_RSA' is found in the database.
If that isn't the case, it will throw this warning and explains why it is happening.
Typing !ss , then filling in the form for 'General settings' and reloading the Lapper config, will clear the warning.
Of course, I still need to solve the issue with the admin-check, otherwise typing !ss won't get you anywhere Smile
Will get back to you guys about this.
Yisc[NL]
S3 licensed
Tonight a bug was reported to me, which is about the UTC time being calculated wrongly from the local time.
I've fixed this bug and while testing, found another one and fixed that as well.

Changelog for Schedule V2.03:

-Fixed a bug in Sub 'Schedule' where UTC was calculated by adding(+) hours to local time, instead of substracting(-) hours from local time
-Fixed a bug in Sub 'Schedule' where Hours were displayed as 24 instead of 00
-Fixed a bug in Sub 'Schedule_trackcheck' where Hours were displayed as 24 instead of 00

Change the extension of the file to .lpr and add it to addonsused.lpr to be able to use it.
Yisc[NL]
S3 licensed
Quote from Scawen :Thanks but the development isn't stagnant. In fact LFS is undergoing a major graphical overhaul at the moment.

If development was stagnant it's really unlikely it would still be going after 15 years. Most other games have come and gone long before 15 years have passed.

What you mean by stagnant is "not as fast as you would like". So better say that instead. We're working very hard on the updates.

Please can we just stick to the point of the thread?

Thanks for this comment and in fact some sort of mini update on what's going on behind the scenes.
LFS still is a great game and will be around for a long time to come, no matter what others will keep saying about it.
I still enjoy the ride and all the possibilities LFS offers me, so thanks for all the hard work Scawen, Eric and Victor.
Yisc[NL]
S3 licensed
I am not sure about Airio, but Lapper stores it per host and I think Airio does the same.
Yisc[NL]
S3 licensed
Programs like Airio and Lapper store such information in their own database for future reference. So you won't be able to find such information elsewhere.
Yisc[NL]
S3 licensed
Have you opened an Insim port in your Dcon config?

Using: /insim=29999

Value can be anything between 1 and 65535

You might want to take a look at the file Commands_Dcon to see what else is possible to set in the config file.
Yisc[NL]
S3 licensed
Have you set the correct mode?

Using: /mode=s2

Mode can be value: demo, s1, s2 or s3
Yisc[NL]
S3 licensed
Somebody asked be something about this script and while playing with the buttons, I managed to crash Lapper, which lead to this being written into the logfile:

Quote :11/24/2017 3:46:43 PM

Lapper Instance 127.0.0.1/29994 abort!

Input string was not in a correct format.
mscorlib
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Byte.Parse(String s, NumberStyles style, NumberFormatInfo info)
at System.Byte.Parse(String s)
at LFSLapper.LFSClient.startlightcontrol(unionVal val, ArrayList args)
at GLScript.GLApp.parseBackcall(SetOfVars GVAR, SetOfVars LVAR, unionVal val, ArrayList args)
at GLScript.Parseur.getval(SetOfVars GVAR, SetOfVars LVAR, executeParsedFunction BC)
at GLScript.GLApp.retrieveEvalVar(String funcName, TokenParse tkparse, TokenBuffer currTokenBuffer, SetOfVars GVAR, SetOfVars LVAR, Boolean breakFunc, Char& breakCar)
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
at GLScript.GLApp.privExecuteFunction(String funcName, String[] argsVals)
at GLScript.GLApp.executeFunction(String funcName, String[] argsVals)
at Configurator.lexConfigurator.executeFunction(String funcName, infoPlayer pcurrInfoPlayer, String[] par)
at LFSLapper.LFSClient.managePacket(BTC btc)
at LFSLapper.LFSClient.Loop(Connect insimConnection)
at LFSLapper.LFSClient.doloop()
at LapperInstances.LapperInstance.doConnection()
Void StringToNumber(System.String, System.Globalization.NumberStyles, NumberBuffer ByRef, System.Globalization.NumberFormatInfo, Boolean)
Closing Instance...

Sadly I haven't been able to reproduce this crash, so no idea what went wrong exactly.

I made a small improvement to the script, by limiting the user input to only the valid values for each field.
When an invalid value is entered, a warning is shown telling the user what the valid valies for that field are.

Changelog for V1.1:

- Restricted user input for each field to only valid values for that field, otherwise display a warning

Change the extension of the file to .lpr and add it to addonsused.lpr to be able to use it.
Yisc[NL]
S3 licensed
I've created this little test-script for streets, tested it and it's working as intended.
The 'test_street' is situated down the pitlane of track BL1 (see attached screenshot).


<?php 
CatchEvent OnLapperStart
()
    
OnLapperStart_test_street();
EndCatchEvent

Sub OnLapperStart_test_street
()
    
$street_width=5;
    
$start_street="-40,300";
    
$end_street="-14,373";
    
$street_values="".$street_width.",".$start_street.",".$end_street;
    
RegisterStreetAction"test_street","BL1","".$street_valuesEnterStreet LeaveStreet );
EndSub

Sub EnterStreet 
($userName)
    
SetCurrentPlayerVar"current_street"GetCurrentPlayerVar"idCurrStreet" ) );
    
PrivMsg "^7You are now driving on: " GetCurrentPlayerVar"current_street" )  );

Endsub

Sub LeaveStreet 
($userName)
    
PrivMsg "^7You have now left: " GetCurrentPlayerVar"current_street" ) );
    
SetCurrentPlayerVar"current_street""" );
Endsub
?>


FGED GREDG RDFGDR GSFDG